<template>
	<view class="announce">
		<view>
			<u-tabs-swiper  :list="list" ref="tabs" :height="100" :is-scroll="false" :bold="false" :current="current" @change="tabsChange" active-color="#de4f38" :bar-width="80" :bar-height="6"></u-tabs-swiper >
		</view>
		<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="swiper-box" >
			<swiper-item class="swiper-item">
				<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
					<view class="list" v-if="listData.length>0">
						<view class="item" v-for="(item,index) in listData" :key="index">
							<view class="u-flex item-bottom">
								<view class="">
									<u-radio-group v-model="value">
										<u-radio  @change="radioChange" active-color="#de4f38" :name="item.type" :size="30"></u-radio>
									</u-radio-group>
								</view>
								<view class="u-flex u-row-between box">
									<view class="u-flex u-row-between">
										<view>
											<u-image
											class="image" 
											width="120rpx" 
											height="120rpx" 
											border-radius="120rpx"
											:src="item.url"></u-image>
										</view>
										<view class="item-info u-p-l-20">
											<view class="name u-m-b-30">{{item.name}}</view>
											<view class="txt">{{item.time}}</view>
										</view>
									</view>
									<view class="item-info">
										<view class="name u-m-b-30">{{item.num}}</view>
										<view class="txt">{{item.des}}</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- 底部 -->
					<view class="list-foot u-p-r-30 u-p-l-30 u-flex u-row-between">
						<view>总计：<text class="num">¥500</text></view>
						<view class="u-flex u-row-between">
							<view class="u-m-r-20"><u-button type="info" class="error" shape="circle" hover-class="none">拒绝合作</u-button></view>
							<view><u-button type="error" shape="circle" class="send" hover-class="none">确认合作</u-button></view>
						</view>
					</view>
				</scroll-view>
			</swiper-item>
			<swiper-item class="swiper-item">
				<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
					<view class="list" v-if="listData.length>0">
						<view class="item" v-for="(item,index) in listData" :key="index" @click="openShow">
							<view class="u-flex item-bottom">
								<view class="u-flex u-row-between box">
									<view class="u-flex u-row-between">
										<view>
											<u-image
											class="image" 
											width="120rpx" 
											height="120rpx" 
											border-radius="120rpx"
											:src="item.url"></u-image>
										</view>
										<view class="item-info u-p-l-20">
											<view class="name u-m-b-30">{{item.name}}</view>
											<view class="txt">{{item.time}}</view>
										</view>
									</view>
									<view class="item-info">
										<view class="name u-m-b-30">{{item.num}}</view>
										<view class="txt">{{item.des}}</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- 底部 -->
					<view class="list-foot u-p-r-30 u-p-l-30 u-flex u-row-between">
						<view>达人数据快速浏览</view>
						<view class="u-flex u-row-between">
							<view><u-button type="error" shape="circle" class="send" hover-class="none">复制下载链接</u-button></view>
						</view>
					</view>
				</scroll-view>
			</swiper-item>
			<swiper-item class="swiper-item">
				<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
					<view class="list" v-if="listData.length>0">
						<view class="item" v-for="(item,index) in listData" :key="index">
							<view class="u-flex item-bottom">
								<view class="u-flex u-row-between box">
									<view class="u-flex u-row-between">
										<view>
											<u-image
											class="image" 
											width="120rpx" 
											height="120rpx" 
											border-radius="120rpx"
											:src="item.url"></u-image>
										</view>
										<view class="item-info u-p-l-20">
											<view class="name u-m-b-30">{{item.name}}</view>
											<view class="txt">{{item.time}}</view>
										</view>
									</view>
									<view class="item-info">
										<u-button type="error" shape="circle" class="send" size="medium" hover-class="none">任务审核</u-button>
									</view>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</swiper-item>
		</swiper>
		<u-toast ref="uToast" />
		<!-- 关于千晨 -->
		<u-popup v-model="show" mode="center" width="680" height="760" :border-radius="10">
			<view class="wrap-shop u-padding-30">
				<view class="u-flex u-row-center u-margin-bottom-40 avatar">
					<u-image width="160rpx" height="160rpx" border-radius="160rpx" :src="avatarUrl"></u-image>
				</view>
				<view class="title u-text-center u-margin-bottom-20 u-flex u-row-center">
					<view class="tag">高级</view>
					抖音精品小淘
				</view>
				<view class="item-box-info u-flex u-row-center u-text-center u-m-b-40">
					<view class="info-item">
						<view class="num u-font-lg">1000<text class="u-font-xs">w</text></view>
						<view class="text u-font-sm">粉丝数</view>
					</view>
					<view class="info-item">
						<view class="num u-font-lg">1000<text class="u-font-xs">w</text></view>
						<view class="text u-font-sm">赞藏数</view>
					</view>
					<view class="info-item">
						<view class="num u-font-lg">杭州</view>
						<view class="text u-font-sm">城市</view>
					</view>
				</view>
				
				<view class="u-m-b-20">
					<view class="lab">主页链接<u-button class="u-m-l-40" type="info" shape="circle" size="mini" hover-class="none" :ripple="true">复制</u-button></view>
					<view>www.tome-brand.com</view>
				</view>
				<view class="u-m-b-30">
					<view class="lab">主页链接</view>
					<view class="item-info u-flex u-flex-wrap u-m-t-20">
						<view :class="[index==1?'li action':'li']" v-for="(item,index) in typeList" :key="index">{{item.name}}</view>
					</view>
				</view>
				
				
				<view class="u-flex u-row-between ">
					<u-button type="info" class="u-m-r-20" shape="circle" size="medium" hover-class="none" :ripple="true">取消收藏</u-button>
					<u-button type="info" class="u-m-r-20" shape="circle" size="medium" hover-class="none" :ripple="true">复制微信号</u-button>
					<u-button type="warning" shape="circle" size="medium" class="send" hover-class="none" :ripple="true">联系TA</u-button>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import AnnounceList from '../components/announce-list/index.vue'
	export default {
		components: {
			AnnounceList
		},
		data() {
			return {
				show:false,
				avatarUrl:'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
				list: [{
					name: '报名审核(20）'
				}, {
					name: '已确认合作(26）'
				}, {
					name: '任务审核(36）'
				}],
				current: 0,
				swiperCurrent: 0, 
				value: 0,
				listData:[{
					name:'抖音精品小淘',
					url: 'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
					time:'2021-01-20 12:12:12',
					num:16836,
					des:'粉丝数',
					type:0,
				},{
					name:'抖音精品小淘',
					url: 'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
					time:'2021-01-20 12:12:12',
					num:16836,
					des:'粉丝数',
					type:1,
				},{
					name:'抖音精品小淘',
					url: 'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
					time:'2021-01-20 12:12:12',
					num:16836,
					des:'粉丝数',
					type:3,
				}],
				typeList:[
					{
						id:1,
						name:'抖音'
					},
					{
						id:2,
						name:'小红书'
					},
					{
						id:3,
						name:'快手'
					},
					{
						id:4,
						name:'哔哩哔哩'
					}
				],
			};
		},
		methods: {
			openShow(){
				let that = this;
				that.show= true;
			},
			// 选中某个单选框时，由radio时触发
			radioChange(e) {
				// console.log(e);
			},
			// 选中任一radio时，由radio-group触发
			radioGroupChange(e) {
				// console.log(e);
			},
			tabsChange(index) {
				this.swiperCurrent = index;
			},
			transition(e) {
				let dx = e.detail.dx;
				this.$refs.tabs.setDx(dx);
			},
			animationfinish(e) {
				let current = e.detail.current;
				this.$refs.tabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			},
			onreachBottom() {
				
			}
		}
	};
</script>

<style lang="scss" scoped>
.announce {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--window-top));
	.list{
		padding-top: 20rpx;
		.item{
			background-color: #fff;
			padding: 20rpx 30rpx;
			margin-bottom: 20rpx;
			.box{
				width: 100%;
				.item-info{
					.send{ padding: 0 20rpx;}
					.name{
						font-weight: 600;
						font-size: 32rpx;
					}
					.num{
						color: #666;
						font-size: 28rpx;
					}
				}
			}
		}
	}
	.list-foot{
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		background-color: #fff;
		height: 120rpx;
		line-height: 120rpx;
		.num{
			color: #de4f38;
		}
		
	}
	
	.swiper-box {
		flex: 1;
		.swiper-item {
			height: 100%;
		}
	}
	.error{
		background-color: #CCCCCC;
		color: #fff;
	}
	.send{
		background-color: #de4f38;
	}
	
	
	.wrap-shop{
		.title{
			 margin-bottom: 20rpx;
			.tag{ background-color: #e8c787; color:#000; font-size: 26rpx; padding:5rpx 15rpx; border-radius: 20rpx; }
		}
		.item-box-info{
			display: flex;
			margin-top: 20rpx;
			.info-item{ 
				flex:1;
				.num{ font-weight: 600; font-size: 40rpx; margin-bottom: 20rpx; }
				.u-font-sm{ padding-left: 8rpx; }
			}	
		}
		.item-info{
			.li{
				text-align: center;
				width: 22%;
				background-color: #f5f5f5;
				height: 60rpx;
				line-height: 60rpx;
				border-radius: 60rpx;
				color: #666;
				margin-right: 4%;
				&:nth-child(4n){
					margin-right: 0;
				}
				&.action{
					background-color: #de4f38;
					color: #fff;
				}
			}
		}
	}
	
}
</style>
